package com.cn.ant.modules.user.entity;

import com.cn.ant.common.persistence.MyDataEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 用户信息Entity
 * @author 黄根华
 * @version 2015-09-26
 */
public class UserMain extends MyDataEntity<UserMain> {
	
	private static final long serialVersionUID = 1L;
	private String wechatNo;		// 微信号
	private String appId;//公众号ID
	private String openId;		// 微信openId
	private String accessCode;		// 授权码
	private String expiresIn;//
	private String refreshToken;//用户刷新access_token
	private Date accessTime;		// 授权时间

	/**
	 * 微信基本信息 start
	 */
	private String nickName;
	private String sex;
	private String province;
	private String city;
	private String country;
	private String headPic;		// 头像
	/**
	 * 微信基本信息end
	 */
	private String kmType;		// 科目（文理）
	private String areaCode;		// 地区
	private String gkScore;		// 高考分数
	private String batchLevel;		// 批次
	private Date lastLoginTime;		// 最后登录时间
	private Date registTime;		// 注册时间

	private String areaName;//区域名称
	
	public UserMain() {
		super();
	}

	public UserMain(String id){
		super(id);
	}

	@Length(min=0, max=64, message="微信号长度必须介于 0 和 64 之间")
	public String getWechatNo() {
		return wechatNo;
	}

	public void setWechatNo(String wechatNo) {
		this.wechatNo = wechatNo;
	}
	
	@Length(min=0, max=64, message="微信openId长度必须介于 0 和 64 之间")
	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}
	
	@Length(min=0, max=64, message="授权码长度必须介于 0 和 64 之间")
	public String getAccessCode() {
		return accessCode;
	}

	public void setAccessCode(String accessCode) {
		this.accessCode = accessCode;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getAccessTime() {
		return accessTime;
	}

	public void setAccessTime(Date accessTime) {
		this.accessTime = accessTime;
	}
	
	@Length(min=0, max=128, message="头像长度必须介于 0 和 128 之间")
	public String getHeadPic() {
		return headPic;
	}

	public void setHeadPic(String headPic) {
		this.headPic = headPic;
	}
	
	@Length(min=0, max=4, message="科目（文理）长度必须介于 0 和 4 之间")
	public String getKmType() {
		return kmType;
	}

	public void setKmType(String kmType) {
		this.kmType = kmType;
	}
	
	@Length(min=0, max=10, message="地区长度必须介于 0 和 10 之间")
	public String getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}
	
	@Length(min=0, max=11, message="高考分数长度必须介于 0 和 11 之间")
	public String getGkScore() {
		return gkScore;
	}

	public void setGkScore(String gkScore) {
		this.gkScore = gkScore;
	}
	
	@Length(min=0, max=4, message="批次长度必须介于 0 和 4 之间")
	public String getBatchLevel() {
		return batchLevel;
	}

	public void setBatchLevel(String batchLevel) {
		this.batchLevel = batchLevel;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getRegistTime() {
		return registTime;
	}

	public void setRegistTime(Date registTime) {
		this.registTime = registTime;
	}

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getRefreshToken() {
		return refreshToken;
	}

	public void setRefreshToken(String refreshToken) {
		this.refreshToken = refreshToken;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getExpiresIn() {
		return expiresIn;
	}

	public void setExpiresIn(String expiresIn) {
		this.expiresIn = expiresIn;
	}

	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}
}